package com.xiashitech.agent.instrumentation.apachehttpclient.v4.inst;

import com.google.auto.service.AutoService;
import io.opentelemetry.javaagent.extension.instrumentation.InstrumentationModule;
import io.opentelemetry.javaagent.extension.instrumentation.TypeInstrumentation;

import java.util.Arrays;
import java.util.List;

import static java.util.Collections.singletonList;

@AutoService(InstrumentationModule.class)
public class ApacheHttpClientv4InstrumentationModule extends InstrumentationModule {

  public ApacheHttpClientv4InstrumentationModule() {
    super("apache-httpclient", "apache-httpclient-v4");
  }

  @Override
  public List<TypeInstrumentation> typeInstrumentations() {
    return singletonList(new ApacheHttpClientv4Instrumentation());
  }

  public List<String> getAdditionalHelperClassNames() {
    return Arrays.asList("com.xiashitech.agent.instrumentation.apachehttpclient.common.v4.HttpClientHeaderGetter",
            "com.xiashitech.agent.instrumentation.apachehttpclient.v4.inst.ApacheHttpClientHelper",
            "com.xiashitech.agent.instrumentation.dubbo.XSDubboLt27Handler",
            "com.xiashitech.agent.instrumentation.apachehttpclient.ApacheHttpClientHandler",
            "com.xiashitech.agent.instrumentation.apachehttpclient.v4.inst.WrappingReentryValueResponseHandler");
  }
}
